<?php
require_once("xforms/Core.php");

class XForms_submission extends XForms_Core {
  protected $tpl='new XForms_submission({renderJson},{renderInstanceData})';
  protected $script = '';
  function renderInstanceData() {
    $data = $this->getBinding();
    if(!$data) $data = $this->getEvaluationContext();
    if($data) {
      $id = $data->getAttribute("id");
      if(!$id) $id = $this->xforms_processor->getXPath($data);
    } else {
      $id = null;
    }
    return json_encode($id);
  }
}
